//
//  UIBarButtonItem+Extension.swift
//  MyWeiboApp
//
//  Created by 胡海波 on 15/7/1.
//  Copyright © 2015年 胡海波. All rights reserved.
//

import UIKit

extension UIBarButtonItem{

    convenience init(imageName:String, highlightImageName:String?) {

        let btn = UIButton()
        btn.frame = CGRectMake(0, 0, 30, 30)

        btn.setImage(UIImage(named: imageName), forState: UIControlState.Normal)

        let highlightName = highlightImageName ?? imageName + "_highlighted"
        btn.setImage(UIImage(named:highlightName), forState: UIControlState.Highlighted)

        self.init(customView:btn)

    }


}
